package com.oversea.interceptor;

import static com.oversea.util.Constants.*;

import java.util.Map;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class LoginInterceptor extends AbstractInterceptor {
	private static final long serialVersionUID = 8633625216211310936L;

	@Override
	public String intercept(ActionInvocation invocation) throws Exception {
		Map<String, Object> session = ServletActionContext.getContext().getSession();
		if (session == null || session.get(LOGIN_USER_JOB_NUMBER_KEY) == null || "".equals(session.get(LOGIN_USER_JOB_NUMBER_KEY))) {
//			return "tologin";
		}
		return invocation.invoke();
		
	}

}
